package com.zzz.demo.utils.java8;

import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @author ZZZ
 * @version 1.0
 * @date 2019/1/22 0022
 */
public class StreamUtil {

    public static <T,R> List<R> map(List<T> data, Function<T, R> mapFunc) {
        return data.stream().map(mapFunc).collect(Collectors.toList()); // stream replace foreach
    }
}
